package animation.wlh.com.animation_demo.basic

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.animation.RotateAnimation
import animation.wlh.com.animation_demo.R
import kotlinx.android.synthetic.main.activity_alpha_anim.*

/**
 * Created by weilh on 2016/1/22.
 */
class RotateAnimationAct : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_rotate_anim)
        title = "旋转动画"
        view.setOnClickListener{
            var anim = RotateAnimation(0f, 360f, view.width / 2f, view.height / 2f)
            anim.duration = 2000
            view.startAnimation(anim)
        }
    }
}
